//
//  RootViewController.m
//  BCProjectB
//
//  Created by lanou3g on 15/12/21.
//  Copyright © 2015年 lanou3g. All rights reserved.
//

#import "RootViewController.h"
#import "MainViewController.h"
#import "TestViewController.h"

@interface RootViewController ()<MainViewControllerDelegate>

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor cyanColor];
    MainViewController *main=[[MainViewController alloc]init];
    TestViewController *test=[[TestViewController alloc]init];
    UINavigationController *nc=[[UINavigationController alloc]initWithRootViewController:test];
   
    [self addChildViewController:main];
    [self addChildViewController:nc];
    [self.view insertSubview:main.view atIndex:0];
    [self.view insertSubview:nc.view atIndex:1];
    main.delegate=test;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
